package com.aisile.user.listener;

import cn.hutool.core.util.IdUtil;
import com.aisile.model.user.dtos.AuthDto;
import com.aisile.user.config.RabbitConfig;
import com.aisile.user.service.ApUserRealnameService;
import com.google.gson.Gson;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.io.UnsupportedEncodingException;

/**
 * @Auther:yry
 * @Date:2024/6/13 0013
 * @VERSON:1.0
 */
@Component
public class AuthSMListener {

    @Autowired
    private ApUserRealnameService apUserRealnameService;


    @RabbitListener(queues = RabbitConfig.AUTH_QUEUE)
    public void autoUpdateStatusById(String id){
        AuthDto dto = new AuthDto();
        dto.setId(Integer.valueOf(id));
        apUserRealnameService.autoUpdateStatusById(dto);
    }

}
